using System.Runtime.InteropServices;
using UnityEngine;

public class WebGLMicrophone : MonoBehaviour
{
    [DllImport("__Internal")]
    private static extern void StartRecording();
    
    [DllImport("__Internal")]
    private static extern void StopRecording();
    
    public static void Start()
    {
        #if UNITY_WEBGL && !UNITY_EDITOR
        StartRecording();
        #endif
    }
    
    public static void Stop()
    {
        #if UNITY_WEBGL && !UNITY_EDITOR
        StopRecording();
        #endif
    }
} 